gnttab: set page refcount for copy-on-grant-transfer
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Mar 2019 13:58:42 +0000 (14:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Mar 2019 13:58:42 +0000 (14:58 +0100)
commit1028304d4244df2ee9af0ca37ee8a6f998c61d9c
tree98459c94cbfc1f45ed6bd207fbfb92a7b3f8e243
parent87f51bf366ca79b98e1e201bf9bd7a9c164631e2
gnttab: set page refcount for copy-on-grant-transfer

Commit 5cc77f9098 ("32-on-64: Fix domain address-size clamping,
implement"), which introduced this functionality, took care of clearing
the old page's PGC_allocated, but failed to set the bit (and install the
associated reference) on the newly allocated one. Furthermore the "mfn"
local variable was never updated, and hence the wrong MFN was passed to
guest_physmap_add_page() (and back to the destination domain) in this
case, leading to an IOMMU mapping into an unowned page.

Ideally the code would use assign_pages(), but the call to
gnttab_prepare_for_transfer() sits in the middle of the actions
mirroring that function.

This is XSA-284.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
master commit: 6d4f36c3fecc0a6a0991716199612c81d909316e
master date: 2019-03-05 13:45:58 +0100
xen/common/grant_table.c